<template>
  <!-- 班列开行计划 -->
  <div class="app-container">
        <div class="cbox">
          <el-form class="searchBox" :model="from" ref="from" :rules="rules" size="mini" >
            <el-row  class="row">
              <el-col :span="3">
                    <el-form-item prop="tboTrain" label-width="5rem" label="车次:">
                      <el-input maxlength="32"  v-model="from.tboTrain" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="3">
                    <el-form-item prop="tboOriginstation" label-width="6rem" label="始发站:">
                      <el-input maxlength="32"  v-model="from.tboOriginstation" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="3">
                    <el-form-item prop="tboFinishstation" label-width="6rem" label="终点站:">
                      <el-input maxlength="32"  v-model="from.tboFinishstation" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="3">
                    <el-form-item prop="tboNum" label-width="8rem" label="列车编号:">
                      <el-input maxlength="32"  v-model="from.tboNum" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item label="发车时间:"  label-width="8rem" prop="tboDeparturedateStart">
                  <el-date-picker v-model="from.tboDeparturedateStart" type="date" placeholder="选择日期时间" value-format="yyyy-MM-dd" clearable></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="~" prop="tboDeparturedateEnd" label-width="2rem" >
                  <el-date-picker v-model="from.tboDeparturedateEnd" type="date" placeholder="选择日期时间" value-format="yyyy-MM-dd" clearable></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="1">
                <el-form-item label-width="10px">
                  <el-button @click="searchType" type="primary">查询</el-button>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <el-row :gutter="10" class="btn-area">
            <el-col :span="24">
              <el-button size="mini" type="success" plain @click="add">发布班列开行计划</el-button>
              <el-button size="mini" type="primary" plain @click="del('diong')">编辑班列开行计划</el-button>
              <el-button size="mini" type="danger" plain @click="examine">取消班列开行计划</el-button>
              <!-- <el-button size="mini" type="primary" plain @click="allocate">预配载</el-button>
              <el-button size="mini" type="primary" disabled plain @click="leading">导出预配载信息</el-button> -->
               <!-- <el-button size="mini" type="primary"  plain @click="chakan">查看</el-button> -->
            </el-col>
        </el-row>
        <div class="table" ref="topType">
              <div class="inner" ref="inner">
                <el-table
                    :data="DetailedData"
                    border
                    :height="maxHeight"
                    :header-cell-style="{ textAlign: 'center' }"
                    highlight-current-row
                    @row-dblclick='rowdbClick'
                    @row-click="rowClick">
                    <el-table-column size="mini" type="index" :index="indexMethod" show-overflow-tooltip  label="序号" width="50"></el-table-column>
                    <el-table-column size="mini" prop="tboNum" show-overflow-tooltip label="班列编号" width="150"></el-table-column>
                    <el-table-column size="mini" prop="tboTrain" show-overflow-tooltip label="车次" width="150"></el-table-column>
                    <el-table-column size="mini" prop="tboType" show-overflow-tooltip label="列车类型" width="150"></el-table-column>
                    <el-table-column size="mini" prop="tboOriginstation" show-overflow-tooltip label="始发站" width="150"></el-table-column>
                    <el-table-column size="mini" prop="tboDeparturedate"  show-overflow-tooltip label="计划发车时间"  width="180"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboTickedDate" show-overflow-tooltip label="实际发车时间"  width="180"></el-table-column>
                    <el-table-column size="mini" prop="tboOrigincity" show-overflow-tooltip label="始发市" width="150"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboLoadtrain" show-overflow-tooltip label="装车组件站" width="180"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboFinishcity" show-overflow-tooltip label="到城市" width="150"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboFinishstation" show-overflow-tooltip label="终点站" width="150"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboUpdownsigns" show-overflow-tooltip label="上下行标记" width="180"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboInsidecar" show-overflow-tooltip label="发运车板数" width="180"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboInsidelastcar" show-overflow-tooltip label="剩余车数"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboInsertdt" show-overflow-tooltip label="输入时间" width="150"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboInsertuser" show-overflow-tooltip label="输入员工" width="150"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboLstupddt" show-overflow-tooltip label="最后修改时间" width="150"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboLstupduser" show-overflow-tooltip label="最后修改员工" width="150"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboRemark" show-overflow-tooltip label="备注" width="150"></el-table-column>
                </el-table>
              </div>
        </div>
          <!-- 分页 -->
          <div class="pages">
        <el-pagination
          class="pagination"
          small
          background
          ref="pagination"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="Pagination.currentPage"
          :page-sizes="Pagination.pageSizeList"
          :page-size="Pagination.pageSize"
          :layout="Pagination.layout"
          :total="Pagination.total"
        ></el-pagination>
        </div>
        <!-- 弹出框 发布班列开行计划/编辑班列开行计划 -->
        <el-dialog
          width="50%"
          v-el-drag-dialog
          :title='addText'
          :visible.sync="addShowA"
          v-if="addShowA"
          :close-on-click-modal="false">
              <el-form  label-width="14rem" :model="xzData"  ref="xzData"  size="mini" :rules="addRules">
                  <el-row>
                    <el-col :span="12">
                        <el-form-item label="车次：" prop="tboTrain">
                          <el-select v-model="xzData.tboTrain" filterable clearable @change='change'>
                            <el-option
                              v-for="item in statusLists"
                              :key="item.tbbId"
                              :label="item.tbbTrain"
                              :value="item.tbbTrain"
                            ></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="发车时间："  prop="tboDeparturedate">
                          <el-date-picker type="datetime" v-model="xzData.tboDeparturedate"  placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss" clearable></el-date-picker>
                        </el-form-item>
                      </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                        <el-form-item prop="tboInsidecar" label="发运车板数：">
                          <el-input maxlength="2" :disabled='disabled'   v-model="xzData.tboInsidecar" clearable></el-input>
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item prop="tboNum" label="班列编号：">
                          <el-input maxlength="32" :disabled='disabled'   v-model="xzData.tboNum" clearable></el-input>
                        </el-form-item>
                      </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                        <el-form-item prop="tboTimelong" label="预计时长：">
                          <el-input maxlength="3" v-model="xzData.tboTimelong" clearable></el-input>
                        </el-form-item>
                      </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="24">
                        <el-form-item prop="tboRemark" label="备注：">
                          <el-input maxlength="200" :disabled='disabled' type="textarea" v-model="xzData.tboRemark" clearable></el-input>
                        </el-form-item>
                      </el-col>
                  </el-row>
              </el-form>
              <!-- 点击编辑后出现的表格 -->
              <div v-if="show">
                <h4>班列基础信息</h4>
                <el-table
                    :data="basicsData"
                    border
                    :height="150"
                    :header-cell-style="{ textAlign: 'center' }"
                    highlight-current-row
                    @row-dblclick='rowdbClick'
                    @row-click="rowClick">
                    <el-table-column size="mini" type="index" show-overflow-tooltip  label="序号" width="50"></el-table-column>
                    <el-table-column size="mini" prop="tbbTrain" show-overflow-tooltip label="车次"></el-table-column>
                    <el-table-column size="mini" prop="tbbType" show-overflow-tooltip label="列车类型"></el-table-column>
                    <el-table-column size="mini" prop="tbbOriginstation" show-overflow-tooltip label="始发站"></el-table-column>
                    <el-table-column size="mini" prop="tbbOrigincity"  show-overflow-tooltip label="始发市" ></el-table-column>
                    <el-table-column size="mini" align="center" prop="tbbLoadtrain" show-overflow-tooltip label="装车组件站"  width="100"></el-table-column>
                    <el-table-column size="mini" prop="tbbFinishcity" show-overflow-tooltip label="到城市"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tbbFinishstation" show-overflow-tooltip label="终点站"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tbbOpencycle" show-overflow-tooltip label="开行周期(列)" width="130"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tbbMincompiled" show-overflow-tooltip label="最小编成数(车)" width="130"></el-table-column>
                    <el-table-column size="mini" prop="tbbMaxcompiled" show-overflow-tooltip label="最大编成数(车)"  width="130"></el-table-column>
                    <el-table-column size="mini" align="center" prop="" show-overflow-tooltip label="操作">
                      <template slot-scope="scope">
                          <div style="text-align:center">
                            <el-button  plain size="mini" type="primary" @click="CK(scope.row)">查看</el-button>
                          </div>
                        </template>
                    </el-table-column>
                </el-table>
                <h4>班列开行计划</h4>
                  <el-table
                    :data="planData"
                    border
                    :height="200"
                    :header-cell-style="{ textAlign: 'center' }"
                    highlight-current-row>
                    <el-table-column size="mini" type="index" show-overflow-tooltip  label="序号" width="50"></el-table-column>
                    <el-table-column size="mini" prop="tboTrain" show-overflow-tooltip label="车次"></el-table-column>
                    <el-table-column size="mini" prop="tboType" show-overflow-tooltip label="列车类型"></el-table-column>
                    <el-table-column size="mini" prop="tboOriginstation" show-overflow-tooltip label="始发站"></el-table-column>
                    <el-table-column size="mini" prop="tboDeparturedate"  show-overflow-tooltip label="始发时间" ></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboOrigincity" show-overflow-tooltip label="始发市"></el-table-column>
                    <el-table-column size="mini" prop="tboLoadtrain" show-overflow-tooltip label="装车组织站"  width="100"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboFinishcity" show-overflow-tooltip label="到城市"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboFinishstation" show-overflow-tooltip label="终点站"></el-table-column>
                    <el-table-column size="mini" align="center" prop="tboInsidecar" show-overflow-tooltip label="发运车板数"  width="100"></el-table-column>
                    <el-table-column size="mini" prop="tboNum" show-overflow-tooltip label="剩余车数"></el-table-column>
                </el-table>
              </div>
               <!-- 分页 -->
                  <el-pagination
                    v-if="show"
                    class="pagination"
                    small
                    background
                    ref="pagination"
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="Pagination.currentPage"
                    :page-sizes="Pagination.pageSizeList"
                    :page-size="Pagination.pageSize"
                    :layout="Pagination.layout"
                    :total="Pagination.total"
                  ></el-pagination>
                <div slot="footer" class="dialog-footer">
                    <el-button size="mini" type="primary" v-if="see" @click="saveEditor">保存</el-button>
                    <el-button size="mini"  @click="close">关闭</el-button>
                </div>
        </el-dialog>
        <!-- 查看弹出框 -->
        <el-dialog
          width="50%"
          :title='addText'
          :visible.sync="addShowB"
          v-if="addShowB"
          append-to-body ='true'
          :close-on-click-modal="false">
          <el-form class="searchBox" :model='lookOver' ref="lookOver" :rules="addRulesA" size="mini" label-width="15rem" >
            <el-row  class="row">
              <el-col :span="12">
                    <el-form-item prop="tbbTrain"  label="车次：">
                      <el-input maxlength="32"  v-model="lookOver.tbbTrain" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item label="列车类型：" prop="tbbType">
                      <el-select v-model="lookOver.tbbType" filterable clearable @change='change'>
                        <el-option
                          v-for="item in typeData"
                          :key="item.code"
                          :label="item.name"
                          :value="item.code"
                        ></el-option>
                      </el-select>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbLoadtrain" label="装车组织站：">
                      <el-input maxlength="32"  v-model="lookOver.tbbLoadtrain" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbLoadtraindbm" label="装车组织站电报码：">
                      <el-input maxlength="32"  v-model="lookOver.tbbLoadtraindbm" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbOriginstation"  label="始发站：">
                      <el-input maxlength="32"  v-model="lookOver.tbbOriginstation" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbOriginstationdbm"  label="始发站电报码：">
                      <el-input maxlength="32"  v-model="lookOver.tbbOriginstationdbm" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbOrigincity"  label="始发城市：">
                      <el-input maxlength="32"  v-model="lookOver.tbbOrigincity" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbFinishstation"  label="终点站：">
                      <el-input maxlength="32"  v-model="lookOver.tbbFinishstation" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbFinishstationdbm"  label="终点站电报码：">
                      <el-input maxlength="32"  v-model="lookOver.tbbFinishstationdbm" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbFinishcity"  label="终到城市：">
                      <el-input maxlength="32"  v-model="lookOver.tbbFinishcity" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbSpeed"  label="速度标尺(千米/时)：">
                      <el-input maxlength="32"  v-model="lookOver.tbbSpeed" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbOpencycle"  label="开行周期(列/周)：">
                      <el-input maxlength="32"  v-model="lookOver.tbbOpencycle" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbMincompiled"  label="最小编成量数：">
                      <el-input maxlength="32"  v-model="lookOver.tbbMincompiled" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbMaxcompiled"  label="最大编成量数：">
                      <el-input maxlength="32"  v-model="lookOver.tbbMaxcompiled" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbGroupcontent"  label="编组内容：">
                      <el-input maxlength="32"  v-model="lookOver.tbbGroupcontent" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                  <el-form-item label="班列上下行：" prop="tbbUpdown">
                    <el-select v-model="lookOver.tbbUpdown" filterable clearable>
                      <el-option
                        v-for="item in blockTrain"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      ></el-option>
                    </el-select>
                  </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbOperationhours"  label="运行时间(小时)：">
                      <el-input maxlength="32"  v-model="lookOver.tbbOperationhours" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="12">
                    <el-form-item prop="tbbFreightmileage"  label="铁路货运里程(公里)：">
                      <el-input maxlength="32"  v-model="lookOver.tbbFreightmileage" clearable></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="24">
                    <el-form-item prop="tbbRemark"  label="备注：">
                      <el-input maxlength="32" type="textarea"  v-model="lookOver.tbbRemark" clearable></el-input>
                    </el-form-item>
              </el-col>
            </el-row>

          </el-form>
          <div slot="footer" class="dialog-footer">
                    <!-- <el-button size="mini" type="primary" v-if="see" @click="saveEditor('xzData')">保存</el-button> -->
              <el-button size="mini"  @click="closeView">关闭</el-button>
          </div>
        </el-dialog>

  </div>
</template>

<script>
import {
  GetTrainOutsetPlanModelList,
  AddOrEditTrainOutsetPlan,
  EditTrainOutsetPlan,
  DeleteTrainOutsetPlan,
  GetClassColumnModelList
} from '@/request/api'
import resizeMixin from '@/mixins/resize'
import paginationMixin from '@/mixins/pagination'
export default {
  mixins: [resizeMixin,paginationMixin],
  data(){
    return{
      disabledA:false,
      disabled:false,
      show:true,
      from:{
        tboTrain:'', //车次
        tboOriginstation:'',//始发站
        tboFinishstation:'',//终点站
        tboNum:'',//列车编号
        tboDeparturedateStart:'',//下单开始时间
        tboDeparturedateEnd:'',//下单结束时间
      },
      //查看弹出框
      lookOver:{

      },
      maxHeight:-1,
      // 弹出框 车次下拉框数据
      statusLists:[

      ],
      //查看弹出框 班列上下行数据
      blockTrain:[
        {code:'上行',name:'上行'},
        {code:'下行',name:'下行'},
      ],
      //查看弹出框 列车类型
      typeData:[
        {code:'班列',name:'班列'},
        {code:'散列',name:'散列'},
      ],
      diong:'E',
      addText:'',
      addShowA:false, // 新增 编辑
      addShowB:false,//查看
      addShowC:false,//预配载
      see:true, //保存按钮
      DetailedData:[], //主列表的数据
      basicsData:[],//弹出框 班列基础信息列表数据
      planData:[],//弹出框  班列开行计划信息列表数据
      xzData:[],// 传给新增 编辑弹出框的数据
      ContainerData:[],//预配载弹出框 集装箱数据
      itemData:[],//当前行数据
      //表单验证 新增 编辑
      addRules:{
        tboTrain:[
          { required: true, message: '请选择车次', trigger:'change'},
        ],
        tboDeparturedate:[
          { required: true, message: '请选择发车日期', trigger:'blur'}
        ],
        tboInsidecar:[
          { required: true, message: '请填写发运车板数', trigger:'blur'},
          {
            pattern:  /^[0-99]*$/,
            message: '只能输入数字',
            trigger: 'blur'
          }
        ],
        tboNum:[
          { required: true, message: '请填写班列编号', trigger:'blur'},
          {
            pattern: /^([^\u4e00-\u9fa5])+$/,
            message: '禁止输入中文',
            trigger: 'blur'
          }
        ],
        tboTimelong:[
          { required: true, message: '请填写预计时长', trigger:'blur'},
          {
            pattern:  /^[0-99]*$/,
            message: '只能输入数字',
            trigger: 'blur'
          }

        ],
      },

    }
  },
  created(){
    this.resize=()=>{
      this.maxHeight=this.$refs.inner.offsetHeight
    }
  },
  mounted(){
    // this.dataList()
    this.refreshList()
    this.getBasic('')
  },
  methods:{
    //查询基础信息
    getBasic(tbbTrain){
      GetClassColumnModelList({
        tbbTrain:tbbTrain,
        tbbOriginstation:'',
        tbbFinishstation:'',
        PageIndexs:'',
        PageSizes:''
      }).then(response => {
        this.statusLists = response.data.FTKJWLHYPT
      })
    },
    //保存
    saveEditor(){
      this.$refs.xzData.validate(valid=>{
        if(valid){
          if(this.diong==='E'){
            //编辑
            EditTrainOutsetPlan(this.xzData).then(res=>{
              if(res.success==='1'){
                this.$message({
                  type:'success',
                  message:'编辑数据成功'
                })
                this.close()
              }
            })
          }else{
            //新增
            AddOrEditTrainOutsetPlan(this.xzData).then(res=>{
              if(res.success==='1'){
                this.$message({
                  type:'success',
                  message:'新增数据成功'
                })
                this.close()
              }
            })
          }
        }
      })
    },
    //转换大写
    uppercase(key) {
      this.xzData[key] = this.xzData[key].toUpperCase()
    },
    change(name){
      this.show=true
      this.basicsData=[]
      this.statusLists.forEach(item=>{
        if(item.tbbTrain===name){
          // console.log(name)
          this.basicsData.push(item)
          this.xzData.tboTbbId=item.tbbId
        }
      })
      GetTrainOutsetPlanModelList({
        tboTrain:this.xzData.tboTrain,//车次
        tboOriginstation:'',//始发站
        tboFinishstation:'',//终点站
        tboNum:'',//班列编号【列车编号】
        tboDeparturedateStart:'',//发车初始日期
        tboDeparturedateEnd:'',//发车末端日期
        PageIndexs:'',
        PageSizes:''
      }).then(response => {
        this.planData = response.data
        this.updatePaginationTotal(Number(response.total))
      })
    },

    //列表数据
    getList(currentPage, pageSize, updateTotal) {
      this.currentData = {}
      GetTrainOutsetPlanModelList({
        tboTrain:this.from.tboTrain,//车次
        tboOriginstation:this.from.tboOriginstation,//始发站
        tboFinishstation:this.from.tboFinishstation,//终点站
        tboNum:this.from.tboNum,//班列编号【列车编号】
        tboDeparturedateStart:this.from.tboDeparturedateStart,//发车初始日期
        tboDeparturedateEnd:this.from.tboDeparturedateEnd,//发车末端日期
        PageIndexs:this.Pagination.currentPage.toString(),
        PageSizes:this.Pagination.pageSize.toString()
      }).then(response => {
        this.DetailedData = response.data
        updateTotal(Number(response.total))

      })
    },
    // 点击搜索
    searchType(){
      this.refreshList()
    },
    //发布班列开行计划
    add(){
      this.addText='新增班列开行计划'
      this.diong=''
      this.addShowA=true
      this.see = true
      this.show=false
      this.xzData = {
        splCode:'',
        splName:'',
        splEname:'',
        splShortname:'',
        splUrl:'.',
      }
    },
    //编辑班列开行计划
    del(){
      if(Object.keys(this.itemData).length){
        this.xzData = this.itemData
        this.addText='编辑班列开行计划'
        this.diong='E'
        this.addShowA=true
        this.see = true
        this.show=true
      }else{
        this.$alert('请选择需要编辑的数据', '提示', {
          confirmButtonText: '确定'
        })
        return false
      }
    },
    //取消班列开行计划
    examine(){
      if (Object.keys(this.itemData).length == 0) {
        this.$alert('请选择需要取消的班列', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.$confirm('您确认要取消此班列吗?', '提示', {
        closeOnClickModal: false
      }).then(() => {
        DeleteTrainOutsetPlan({tboId:this.itemData.tboId}).then(res=>{
          if(res.success !== '1'){
            this.$message({
              type: 'success',
              message: '取消失败'
            })
            return
          }else{
            this.$message({
              type: 'success',
              message: '取消成功'
            })
            // this.dataList()
            this.close()
          }
        })
      }).catch(() => {})

    },
    //获取当前行数据
    rowClick(row){
      this.itemData= Object.assign({},row)
    },
    // 查看
    CK(row){
      // console.log(row,614)
      this.lookOver=Object.assign({},row)
      // this.itemData = []
      this.addText='查看班列信息'
      this.addShowB=true
    },
    //关闭查看弹出框
    closeView(){
      this.addShowB = false
      this.lookOver={}
      this.$refs.lookOver.resetValidate()
    },
    // 关闭弹出框
    close(){
      this.itemData={}
      this.addShowA=false
      this.show = false
      this.refreshList()
    }
  }
}
</script>

<style  lang="scss" scoped>

.leftTable{
  width: 49%;
  display: inline-block;
  // display: flow-root;
  h4{
    margin-bottom:10px;
  }
}
.rightTab{
  width: 51%;
  padding-left: 6px;
  // float: left;
  display: inline-block;
  h4{
    margin-bottom:10px;
  }
}
::v-deep .searchBox {
  .el-checkbox {
    padding-top: 6px;
    margin-right: 0;
  }

}
.el-select {
  width: 100%;
}
.app-container {
  height: 100%;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  .cbox{
    height:50px;
  }
  .btn-area{
    height:50px;
    line-height:50px;
  }
  .table {
    flex: 1;
    overflow: hidden;
    .inner {
      width: 100%;
      height: 100%;
      overflow: hidden;
    }
  }
   .pages{
      height: 30px;

    }
}
</style>
